package com.lww.feature.util;

import java.io.IOException;
import java.util.List;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

/**
 * @author yi an
 * @date 2017/3/28
 */
public class CsvUtil {
    //格式
    public static CSVFormat csvFormat = CSVFormat.DEFAULT.withRecordSeparator('\n');

    /**
     * 写到输出流
     * @param csvPrinter
     * @param headers
     * @param concents
     * @throws IOException
     */
    public static void writerCsvToAppendable(CSVPrinter csvPrinter, List<String> headers, List<List<String>> concents) throws IOException {
            csvPrinter.printRecord(headers);//输出头
            csvPrinter.printRecords(concents);//输出内容
    }


}
